﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LDSP.BRL;

namespace LDSP.UI.EnterpriseAdmin
{
    public partial class SystemSetting : LDSP.BRL.BaseEnterpriseAdminPage
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (this.RB())
                {
                    if (!IsPostBack)
                    {
                        this.InitDataSelect();
                    }
                }
            }
            catch (Exception ex)
            {
                this.HandlerException(ex);
            }
        }

        protected bool RB()
        {
            return this.AllowEnterpriseUser();
        }

        protected void InitDataSelect()
        {
            this.txt_implement_lable.Text = this.LoginUser.Enterprise.EnterpriseConfig.ActionFieldName;
            this.txt_self_evaluation_lable.Text = this.LoginUser.Enterprise.EnterpriseConfig.SelfEvaluationFieldName;
        }

        protected void ValidateDataBefore()
        {
        }

        protected void ValidateDataAfter()
        {

        }
        protected void SetData()
        {
            this.ValidateDataBefore();
            this.LoginUser.Enterprise.EnterpriseConfig.ActionFieldName = this.txt_implement_lable.Text;
            this.LoginUser.Enterprise.EnterpriseConfig.SelfEvaluationFieldName = this.txt_self_evaluation_lable.Text;
            this.ValidateDataAfter();
        }

        protected void btn_ok_Click(object sender, EventArgs e)
        {
            try
            {
                this.SetData();
                this.JSAlert("更新成功！");
                this.InitDataSelect();
            }
            catch (Exception ex)
            {
                this.HandlerException(ex);
            }
        }
    }

}